<div class="panel panel-default">
  <!-- Default panel contents -->
  <div class="panel-heading">车展配套费用
  <font class="col-md-offset-1" color="red">(所导入车展配套金额为<?=$subsidyMatching?>元)</font>
  </div>
  <table class="table table-bordered">
    <thead>
      <tr>
        <th class="bg-primary text-center">流水号</th>
        <th class="bg-primary text-center">类型</th>
        <th class="bg-primary text-center">费用项目描述</th>
        <th class="bg-primary text-center">费用使用时间段</th>
        <th class="bg-primary text-center">预算申请费用</th>
        <th class="bg-primary text-center">备注</th>
        <th class="bg-primary text-center">结算申请费用</th>
        <th class="bg-primary text-center">自证照片</th>
        <th class="bg-primary text-center">结算审核结果</th>
        <th class="bg-primary text-center">结算审核费用</th>
        <?php /*if(in_array($action, array('edit'))){ ?>
        <th class="bg-primary text-center hidden">是否结算该项</th>
        <?php } */?>
        <?php if (in_array($action, array('audit'))) {?>
        <th class="bg-primary text-center">操作</th>
        <?php } ?>
      </tr>
    </thead>
    <tbody>
    <?php foreach($matchingList as $k => $v): ?>
      <tr>
        <td class="text-center"><?=$v['id']?></td>
        <td class="text-center"><?=$v['typeStr']?></td>
        <td class="text-center"><?=$v['descTypeStr']?></td>
        <td class="text-center"><?=$v['startTime'].'至'.$v['endTime']?></td>
        <td class="text-center"><?=$v['budgetApply']?></td>
        <td class="text-center"><?=$v['remarks']?></td>
        <td class="text-center">
          <?php if (in_array($action, array('edit'))) {?>
            <?php if (in_array($v['settleAuditRs'], array(-1,0,3)) ) {?>
            <input type="number" style="width: 100px;" required min="0" step="0.01" class="form-control" id="matching[<?=$v['id']?>][settleApply]" name="matching[<?=$v['id']?>][settleApply]" value="<?=(float)$v['settleApply']?$v['settleApply']:$v['budgetAudit']?>" placeholder="实际费用">
            <input type="hidden" name="matching[<?=$v['id']?>][isSettle]" id="matching[<?=$v['id']?>][isSettle]" value="1">
            <?php }else{echo $v['settleApply'];} ?>
          <?php } ?>
          <?php
          if (in_array($action, array('audit','check'))) {
            echo $v['settleApply'];
          }
          ?>
          <?php if (in_array($action, array('change'))) {?>
            <input type="number" style="width: 100px;" required min="0" step="0.01" class="form-control" id="matching[<?=$v['id']?>][settleApply]" name="matching[<?=$v['id']?>][settleApply]" value="<?=(float)$v['settleApply']?$v['settleApply']:$v['budgetAudit']?>" placeholder="实际费用">
            <input type="hidden" name="matching[<?=$v['id']?>][settleAuditRs]" id="matching[<?=$v['id']?>][settleAuditRs]" value="<?=$v['settleAuditRs']?>">
          <?php } ?>
        </td>
        <td class="text-center col-sm-2">
            <div id="matchingUpload<?=$v['id']?>ImgBox" style="width:200px;overflow:hidden;">
              <?php if ($v['fileData']) {?>
              <a target="_blank" href="<?=$v['fileData']['viewPath']?>" class="thumbnail">
                <img class="carousel-inner img-responsive img-rounded" src="<?=$v['fileData']['viewPath']?>">
              </a>
              <?php } ?>
            </div>
            <?php if (in_array($action, array('edit')) && in_array($v['settleAuditRs'], array(-1,0,3))) { ?>
            <input type="hidden" id="matchingUpload<?=$v['id']?>FileId" name="matching[<?=$v['id']?>][fileId]" value="<?=$v['fileId']?>" readonly="readonly">
            <input type="button" id="matchingUpload<?=$v['id']?>" value="上传" />
            <?php
              $matchingButtonIds[] = 'matchingUpload'.$v['id'];
            }
            ?>
        </td>
        <td class="text-center"><?php echo $v['settleAuditStr'] ?></td>
        <td class="text-center"><?php echo $v['settleAudit'] ?></td>
        <?php /*if (in_array($action, array('edit'))) {?>
        <td class="text-center col-sm-1 hidden">
          <?php
          if (in_array($v['settleAuditRs'], array(-1,0,3))) {
            $options = $this->config->item('isSettleOptions');
            $extra = ' class="form-control" style="width:70px;" ';
            $v['isSettle'] = 1;
            echo form_dropdown('matching['.$v['id'].'][isSettle]', $options, $v['isSettle'], $extra);
          }
          ?>
        </td>
        <?php } */?>
        <?php if (in_array($action, array('audit'))) {?>
        <td class="text-center">
          <?php
          $options = $this->config->item('settleAuditOptions');
          $extra = ' class="form-control" style="width:70px;" '.($this->user['userRole']>=$v['settleAuditRole']?'':'disabled');
          echo form_dropdown('matching['.$v['id'].'][settleAuditRs]', $options, $v['settleAuditRs'], $extra);
          ?>
        </td>
        <?php } ?>
      </tr>
    <?php endforeach; ?>
    </tbody>
  </table>
</div>
<?php initUploadButtons($matchingButtonIds, printUrl('Upload','uploadSave',array('dir'=>'image')), 'imgFile'); ?>